package com.wjbgn.electronicnian.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * Description:
 * Create Date: 2022-01-20T11:06:12.859722400
 *
 * @author weirx
 * @version 1.0
 */
@Data
@TableName(value = "nian")
public class NianDO {

    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    public NianDO(Long id, Integer hungryNum) {
        this.id = id;
        this.hungryNum = hungryNum;
    }

    public NianDO(Long userId, String nianName, Integer hungryNum) {
        this.userId = userId;
        this.nianName = nianName;
        this.hungryNum = hungryNum;
    }
    public NianDO() {
    }

    public NianDO(Long userId) {
        this.userId = userId;
    }

    /**
     * 主人id
     */
    private Long userId;

    /**
     * 年兽名称
     */
    private String nianName;

    /**
     * 年兽饥饿值100，0即死亡
     */
    private Integer hungryNum;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * 是否删除 1：是  0否
     */
    private Integer isDelete;

}
